package com.vcc.data.mapper;

import com.mybatisflex.core.BaseMapper;
import com.vcc.core.model.CountData;
import com.vcc.data.entity.UserCard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserCardMapper extends BaseMapper<UserCard> {
    @Select("select DATE_FORMAT(request_date,'%Y-%m-%d') as date ,count(*) as count from vcc_user_card where user_id = #{userId} group by date order by date desc limit 30")
    List<CountData> listByUserId(@Param("userId")Long userId);
}
